package string;

/**
 * valueof()将其他
 */
public class ValueOfDemo {
    public static void main(String[] args) {
        int a=123;
        String s1 =String.valueOf(a);//"123"
        System.out.println(s1);

        double dou =123.123;
        String s2 = String.valueOf(dou);//"123.123"
        System.out.println(s2);

        String s3 =a+"";//在java中任何类型和字符串连接结果都是字符串
        System.out.println(s3);
    }
}
